package com.ktjy.market.mapper;

import com.ktjy.market.pojo.BackendUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ktjy.market.pojo.DevUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author 秦羽墨
* @description 针对表【backend_user】的数据库操作Mapper
* @createDate 2024-05-13 16:53:11
* @Entity com.ktjy.market.pojo.BackendUser
*/
@Mapper
public interface BackendUserMapper extends BaseMapper<BackendUser> {

    @Select("select b.*, d.valueName userTypeName from backend_user b ,data_dictionary d where d.id=b.userType\n" +
            "\n" +
            "and b.userCode=#{user} and b.userPassword=#{password}")
    BackendUser login(@Param("user") String user, @Param("password") String password);


    @Select("select count(*) from backend_user where userCode= #{user}")
    int getUserCount(@Param("user") String user);



}




